$(document).ready(function(){
    $("#buyItem").click(function(){ 
        buyItem();
    });
});

function buyItem () {
    var what = $("#what").val();
    var playerName = $("#char").val();
    var countOfBuy = $("#countOfBuy").val();
    $("#imgLoad").show();
    $("#what").attr("disabled", true);
    $("#char").attr("disabled", true);
    $("#countOfBuy").attr("disabled", true);
    $("#countOfBuy").css("background-color", "grey");
    $.ajax({
        type: "POST",
        url: "gmshop.php",
        data: {
            'char' : playerName,
            'what' : what,
            'countOfBuy' : countOfBuy,
            'buyItem' : 'buyItem'
               
        },
        success: function(msg) {
            $("#showBuyMessage").html(msg);
            $("#imgLoad").hide();
            $("#buyItemSuccess").show("slow");
            $("#buyItem").hide("fast");
        }
    });
}

function openShopInputs() {
	
	
}
